import QtQuick
import QtQuick.Controls

Rectangle{
    id: zButton
    x: 329
    y: 430
    width:200
    height:60
    color: "#EDF1F8"
    radius: 5
    border.width: 1
    border.color: "grey"
    property alias text: label.text
    property alias fontColor: label.color
    signal clicked

    Text{
        id: label
        anchors.centerIn: parent
        font.pixelSize: 22
    }

    SequentialAnimation {
        id: animation
        // 缩小动画
        PropertyAnimation {
            target: zButton
            property: "scale"
            to: 0.95
            duration: 80
        }
        // 恢复动画
        PropertyAnimation {
            target: zButton
            property: "scale"
            to: 1.0
            duration: 80
        }
        ScriptAction { script: zButton.clicked(); } // 动画完成后执行
    }


    MouseArea{
        anchors.fill: parent;
        onClicked: {
            animation.start()
        }
    }

}
